<?php


namespace app\controllers;


use app\behaviors\BEvtBehavior;

class EvtController extends \yii\web\Controller
{
    public function behaviors()
    {
        return ['app\behaviors\BEvtBehavior'];
    }

    public function actionIndex()
    {

//        $this->on('name','function');
//
//        $this->trigger('name');

        echo '开始访问页面<br>';

        $this->trigger(BEvtBehavior::RECORD);

        echo '离开页面<br>';

        $this->trigger(BEvtBehavior::CLEAR);

        $this->trigger(BEvtBehavior::WARN);





    }
}